<?php

use think\facade\Route;

/** 配置*/
Route::group('system/config', function () {
    Route::get('<key>', '@<key>'); // 系统配置页面
    Route::get('$', '@getConfig'); // 获取配置
    Route::post('save', '@save');
    Route::post('face', '@face');
})->prefix('\app\admin\service\system\Config');

/** 系统操作日志 */
Route::get('system/log/list', '\app\admin\service\system\Log@index');

/** 系统消息 */
Route::group('system/message/', function () {
    Route::get('list', 'index');
    Route::get('count', 'noReadCount');
    Route::put('<message_id>/read', 'read');
    Route::put('read$', 'readAll');
})->prefix('\app\admin\service\system\Message@');

Route::group('system/notify', function () {
    Route::group('node', function () {
        Route::get('list', 'index'); // 列表数据
        // 单课程 <id> 课程ID
        Route::group('<id>', function () {
            Route::get('config', 'config'); // 修改-页面
            Route::put('config', 'config'); // 修改-提交
        })->pattern(['id' => '\d+']);
    })->prefix('\app\admin\service\system\notify\NotifyNode@');
});
